<template>
    <div>
      <el-steps :active="currentStep-1" finish-status="success" class="step-container">
        <el-step v-for="item in stepList" :key="item" :title="item"></el-step>
      </el-steps>
      <el-table class="table-container"
        border fit highlight-current-row
        :data="localCheck.attachList">
        <el-table-column type="index" :index="1"></el-table-column>
        <el-table-column
          prop="name"
          label="材料"></el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <a class="link-view-file" @click.stop.preven="openFilePath(scope.row.path)">点击查看</a>
          </template>
        </el-table-column>
      </el-table>
      <div class="btn-container" :style="`margin-left:${labelWidth}`">
        <el-button type="info" @click="cancelView">返回</el-button>
      </div>
    </div>
</template>

<script>
  const formItems = {
  }
  import MyForm from '../../../components/MyForm';
  import * as selectDatas from '../../../constants/select-datas';
    export default {
        name: 'CheckView',
      props:{
        check: Object,
        required: true,
      },
      components:{
        MyForm
      },
      created(){
          this.localCheck=this.check||{attachList:[]};
      },
      watch:{
        check(){
          this.localCheck=this.check||{attachList:[]};
        }
      },
        data() {
            return {
              currentStep: 2,
              stepList:[
                '提交申请',
                '处理中',
                '审核完成',
              ],
              labelWidth: "180px",
              localCheck:{attachList:[]},
            }
        },
      computed:{
      },
      methods:{
        openFilePath(path){
          window.open(path)
        },
        cancelView(){
          this.$emit("cancelView");
        }
      }
    }
</script>

<style lang="stylus" scoped>
  .step-container
    max-width: 1000px
  .table-container
    margin-top: 20px
    max-width: 1000px
  .link-view-file
    cursor pointer
  .btn-container
    margin-top: 20px
</style>
